// Some more forms, it seems that there is a large amount of text pop-ups in Castle,
// maybe its going to be best to have a proc like the one of the scrolls

Page/TempleOfOdin
	window = "TempleOfOdin"
	browse_settings = "size=458x420,display=1;clear=0;border=1;can_close=0;can_resize=0;can_minimize=1;titlebar=0"
	GetPage(href, href_list)
		if(StartsWith(href, "TempleOfOdin"))
			content = {"<HTML><head>
<html>
<head>
</head>
<body>
<form method=get action='byond://'>
<INPUT type="hidden" name="action" value="TempleOfOdin">
<input name=currentbutton type=hidden value='1' name='currentbutton'>
<body scroll=no>
<h3 align="center"><strong>Temple of Odin</strong></h3><CENTER>
<table width="90%" height="283" border="2" frame="box">
  <tr>
      <td width="76%"><input name='options' type=radio value='Healminor' > Heal Minor </td>
          <td width="12%"><div align="right">500</div></td>
              <td width="12%">CP</td>
                </tr>
                  <tr>
      <td><input name='options' type=radio value='Healmedium' > Heal Medium</td>
          <td><div align="right">900</div></td>
              <td>CP</td>
                </tr>
  <tr>
       <td><input name='options' type=radio value='Healmajor' > Heal Major</td>
           <td><div align="right">1400</div></td>
               <td>CP</td>
                 </tr>
  <tr>
       <td> <input name='options' type=radio value='Heal' > Heal</td>
           <td><div align="right">2500</div></td>
               <td>CP</td>
                 </tr>
  <tr>
      <td><input name='options' type=radio value='Removecurse' > Remove Curse</td>
          <td><div align="right">2500</div></td>
              <td>CP</td>
                </tr>
  <tr>
      <td><input name='options' type=radio value='Neutralizep' > Neutralize Poison</td>
          <td><div align="right">1800</div></td>
              <td>CP</td>
                </tr>
  <tr>
      <td><input name='options' type=radio value='RuneofReturn' > Rune of Return</td>
          <td><div align="right">1000</div></td>
              <td>CP</td>
                </tr>
  <tr>
      <td><input name='options' type=radio value='Restorestrength' > Restore Strength</td>
          <td><div align="right">3000</div></td>
              <td>CP</td>
                </tr>
  <tr>
      <td><input name='options' type=radio value='Restoreintelligence' > Restore Intelligence</td>
          <td><div align="right">3000</div></td>
              <td>CP</td>
                </tr>
  <tr>
      <td><input name='options' type=radio value='Restoreconstitution' > Restore Constitution</td>
          <td><div align="right">3000</div></td>
              <td>CP</td>
                </tr>
  <tr>
      <td height="25"><input name='options' type=radio value='Restoredexterity' > Restore Dexterity</td>
          <td><div align="right">3000</div></td>
              <td>CP</td>
                </tr>
  <tr>
      <td height="23"><input name='options' type=radio value='Restoredrainedhp' > Restore Drained HP</td>
          <td><div align="right">3000</div></td>
              <td>CP</td>
                </tr>
   </table>
<input type=submit name="submittype" value='            Cast            '>
<input type=submit name="submittype" value='            Exit            '>
</form>
</body>
</html>"}

			return src


	ProcessPage(href, href_list)
		src.UnDisplayPage(usr)
		usr.Locked = 0
		if(href_list["submittype"]=="            Exit            ") return
		switch(href_list["options"])
			if ("Healminor")
				HealMinor(usr)
			if ("Healmedium")
				HealMedium(usr)
			if ("Healmajor")
				HealMajor(usr)
			if ("Removecurse")
			if ("Neutralizep")
				Neutralize(usr)
			if ("RuneofReturn")
			if ("Restorestrength")
			if ("Restoreintelligence")
			if ("Restoreconstitution")
			if ("Restoredexterity")
			if ("Heal")
				return
		return 0

Page/TheFarm
	window = "TheFarm"
	browse_settings = "size=480x480,display=1;clear=0;border=1;can_close=1;can_resize=0;can_minimize=1;titlebar=0"
	GetPage(href, href_list)
		if(StartsWith(href, "TheFarm"))
			content = {"<HTML><head>
<body scroll=no>

You gaze once more at the charred ruins of the farm where you were raised. You buried the blackened skeletons of your godparents in the remains of the garden the loved, but you can't bury the anger which still seethes at the thought of how they died. Grimly, you vow that nothing will prevent you from avenging their deaths.<BR><br>

The marauders pillaged the farm quite thoroughly. Nowhere in the ruins can you find the amulet left for you by your ture father, whose dying words, whispered to your godfather, were supposedly of its importance to you: of how it could lead you to your fortune and great glory, but only if you proved your worth. Your godparents had promised it to you for your 18th birthday; now you have neither godparents nor birthright, and your birthday has just passed.<BR><Br>

A search for clues in the rubble finds only a confused trail of footprints, eading north towards the mountains. Many of the footprints seem much too large to have come from the boots of bandits or soldiers.<BR><BR>

You look north, wondering: Where might the amulet be by now? To whom must you prove yourself, and how?
<br><BR><BR><center>
<form>
<input type="hidden" name="action" value="TheFarm">
<input type="submit" value="Continue"></center>
"}

			return src

	ProcessPage(href, href_list)
		usr.Locked = 0
		src.UnDisplayPage(usr)

//Jon88's html vars. They're here because I couldn't find anyplace better to put them
proc
	CreatePages()
		var/list/MonsterStates = list()
		var/list/TurfStates = list()
		MonsterStates = icon_states('baddies.dmi')
		TurfStates = icon_states('turf.dmi')
//Create Monster var
		createMonster = {"<HTML><HEAD><TITLE></TITLE></HEAD>
<BODY><H2>Spawn Monsters</H2>
<TABLE><TR><TD><FORM NAME="Main">
Select Monster: <SELECT NAME="MonsterType">
<SCRIPT LANGUAGE="Javascript">
var Monsterlist = new Array([AllMonsters.len + 1]);
"}
		var/i
		for(i=1, i < AllMonsters.len + 1, i++)
			createMonster += {"Monsterlist\[[i]] = "[AllMonsters[i]]";
"}
		createMonster += {"for (i=1;i<[AllMonsters.len + 1];i++) {
document.write("<OPTION VALUE='" + Monsterlist\[i] + "'>" + Monsterlist\[i] + "</OPTION>");
}

function ReloadPage() {
location = "byond://?action=AdminPages;type=reload;Curpage=createMonster;Iconstate=" + Main.MonsterState.options\[Main.
MonsterState.selectedIndex].value + ";Monstertype=" + Main.MonsterType.options\[Main.
MonsterType.selectedIndex].value + ";Monstername=" + Main.MonsterName.value + ";";
}
function CreateMonster() {
location = "byond://?action=AdminPages;type=dostuff;page=createmonster;Monstertype=" + Main.MonsterType.options\[Main.
MonsterType.selectedIndex].value + ";Monstername=" + Main.MonsterName.value + ";Iconstate=" + Main.MonsterState.options\[Main.
MonsterState.selectedIndex].value + ";";
}
</SCRIPT>
</SELECT>
Select icon_state: <SELECT NAME="MonsterState" onBlur="javascript:ReloadPage()">
<SCRIPT LANGUAGE="Javascript">
var Iconlist = new Array([MonsterStates.len + 1]);
"}
		for(i=1, i < MonsterStates.len + 1, i++)
			createMonster += {"Iconlist\[[i]] = "[MonsterStates[i]]";
"}
		createMonster += {"for (i=1;i<[MonsterStates.len + 1];i++) {
document.write("<OPTION VALUE=" + Iconlist\[i] + ">" + Iconlist\[i] + "</OPTION>");
}
</SCRIPT>
</SELECT>
<BR>Choose its name: <INPUT TYPE="text" NAME="MonsterName">
<BR><BR>
<INPUT TYPE="Button" VALUE="Create Monster" onClick="javascript:CreateMonster()">
</FORM></TD><TD VALIGN="top"><IMG SRC="displayimg.png" WIDTH="100"></TD></TR>
</TABLE><SCRIPT LANGUAGE="Javascript">
for (i=1;i<Monsterlist.length - 1;i++) {
"}
		layTurf = {"<HTML><HEAD><TITLE></TITLE></HEAD>
<BODY><CODE><H2>Lay Turf</H2>
<TABLE><TR><TD><FORM NAME="Main">
Select Turf: <SELECT NAME="TurfType">
<SCRIPT LANGUAGE="Javascript">
var Turflist = new Array([AllTurfs.len + 1]);
"}
		for(i=1, i < AllTurfs.len + 1, i++)
			layTurf += {"Turflist\[[i]] = "[AllTurfs[i]]";
"}
		layTurf += {"for (i=1;i<[AllTurfs.len + 1];i++) {
document.write("<OPTION VALUE='" + Turflist\[i] + "'>" + Turflist\[i] + "</OPTION>");
}

function ReloadPage() {
location = "byond://?action=AdminPages;type=reload;Curpage=createTurf;Iconstate=" + Main.TurfState.options\[Main.
TurfState.selectedIndex].value + ";Turftype=" + Main.TurfType.options\[Main.
TurfType.selectedIndex].value + ";Turfname=" + Main.TurfName.value + ";";
}
function LayTurf() {
location = "byond://?action=AdminPages;type=dostuff;page=createturf;Turftype=" + Main.TurfType.options\[Main.
TurfType.selectedIndex].value + ";Turfname=" + Main.TurfName.value + ";Iconstate=" + Main.TurfState.options\[Main.
TurfState.selectedIndex].value + ";Teleportx=" + Main.teleportx.value + ";Teleporty=" + Main.teleporty.value + ";Teleportz=" + Main.teleportz.value + ";Stext=" + Main.stext.value;
}
</SCRIPT>
</SELECT>
<BR>Select icon_state: <SELECT NAME="TurfState" onBlur="javascript:ReloadPage()">
<SCRIPT LANGUAGE="Javascript">
var Iconlist = new Array([TurfStates.len + 1]);
"}
		for(i=1, i < TurfStates.len + 1, i++)
			layTurf += {"Iconlist\[[i]] = "[TurfStates[i]]";
"}
		layTurf += {"for (i=1;i<[TurfStates.len + 1];i++) {
document.write("<OPTION VALUE=" + Iconlist\[i] + ">" + Iconlist\[i] + "</OPTION>");
}
</SCRIPT>
</SELECT>
<BR>Choose its name: <INPUT TYPE="text" NAME="TurfName">
<BR>Teleport: <TABLE><TR><TD>X</TD><TD>Y</TD><TD>Z</TD></TR>
<TR><TD><INPUT TYPE="text" NAME="teleportx" SIZE="3"></TD><TD><INPUT TYPE="text" NAME="teleporty" SIZE="3"></TD><TD><INPUT TYPE="text" NAME="teleportz" SIZE="3"></TD></TR></TABLE>
<BR>Sign Text: <INPUT TYPE="text" NAME="stext">
<BR><BR>
<INPUT TYPE="Button" VALUE="Lay Turf" onClick="javascript:LayTurf()">
</FORM></TD><TD VALIGN="top"><IMG SRC="displayimg.png" WIDTH="100"></TD></TR>
</TABLE><SCRIPT LANGUAGE="Javascript">
for (i=1;i<Turflist.length - 1;i++) {
"}

